package com.sojson.service;

import java.sql.SQLException;

import com.sojson.entity.po.Member;
import com.sojson.util.token.Token;
import com.sojson.util.token.TokenVo;

/**
 * 认证Service
 * 
 * @author liu
 * @date 2021-03-16
 */
public interface AuthcService {

    /**
     * 帐号密码注册
     * 
     * @param token 认证用户Bean
     * @return
     * @throws Exception 
     */
    boolean pwdRegister(TokenVo token) throws Exception;

    /**
     * 短信注册
     * 
     * @param token 认证用户Bean
     * @return
     * @throws Exception 
     */
    Member smsRegister(TokenVo token) throws Exception;

    /**
     * 小程序注册
     * 
     * @param token 认证用户Bean
     * @return
     * @throws SQLException 
     * @throws Exception 
     */
    Member xcxRegister(TokenVo token) throws Exception;

    /**
     * 微信小程序登录
     * 
     * @param token 认证用户Bean
     * @return
     * @throws Exception 
     */
    Object wxXcxLogin(TokenVo token) throws Exception;

    /**
     * 密码登录
     * 
     * @param token 认证用户Bean
     * @return
     * @throws Exception 
     */
    Token pwdLogin(TokenVo token) throws Exception;

    /**
     * 短信登录
     * 
     * @param token 认证用户Bean
     * @return
     * @throws Exception 
     */
    Token smsLogin(TokenVo token) throws Exception;

    /**
     * 移动应用绑定微信
     * 
     * @param code 用户授权后的code
     * @return
     * @throws Exception 
     */
    int wxAppBindOpenid(String code) throws Exception;

    /**
     * 小程序绑定微信
     * 
     * @param code 用户授权后的code
     * @return
     * @throws Exception 
     */
    int wxXcxBindOpenid(String code) throws Exception;

}